|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgametheory.Game
public class Game
Contains all the information for a discrete game of complete information: actions, payoffs, importance games, and equilibria.
Constructor Summary | |
---|---|
Game(int numPlayers,
int numActions)
Creates a new instance of Game |
Method Summary | |
---|---|
void |
calculateUtilities()
Computes utilities for use in importance games and Monte Carlo. |
Game |
deepCopy()
Creates a deep copy of the current game. |
void |
findEfficientEquilibrium()
Compute the efficient equilibrium and store the result through setEfficientIndex. |
int |
findIndexAction(Jama.Matrix findMe)
Calculates the index of an action in the actionList. |
void |
generateEmptyPayoffList()
Creates a new, empty payoff list. |
java.util.ArrayList<Jama.Matrix> |
getActionList()
Get list of actions. |
boolean[] |
getDominatedEnumeration()
Get enumeration of dominated strategies. |
int |
getEfficientIndex()
Get index of the efficient equilibrium. |
java.util.ArrayList<double[]> |
getEquilibria()
Obtain the set of equilibria associated with this game. |
double |
getExpectedValueEquilibrium(int equilibriumNumber)
Computes the expected value of an equilibrium; used for finding the efficient equilibrium in the set. |
double |
getExpectedValueEquilibrium(int equilibriumNumber,
int playerIndex)
Calculate the expected value of a particular equilibrium for a specific player. |
double |
getHQRatio(double[] x,
java.util.ArrayList<Jama.Matrix> expectedProfitsList)
Computes the importance weight for the current game. |
java.util.ArrayList<Game> |
getImportanceGamesList()
Get the importance games list. |
double |
getLambda(int equilibriumIndex,
double[] x)
Computes the probability of an equilibrium being selected in a play of the game. |
int |
getNumActions()
Get the number of actions. |
int |
getNumMixedEqu()
Get the number of mixed strategy equilibria. |
int |
getNumPlayers()
Get number of players. |
int |
getNumPureEqu()
Get the number of pure strategy equilibria. |
Jama.Matrix |
getOutcome()
Get the simulated outcome. |
java.util.ArrayList<Jama.Matrix> |
getPayoffList()
Get deterministic payoff list. |
double |
getProbabilityAction(int actionIndex,
double[] x)
Compute a single moment for this game. |
boolean[] |
getPureEnumeration()
Get enumeration of pure strategies. |
Jama.Matrix |
getSimulatedOutcome()
Simulate an outcome from the game. |
java.lang.String |
getUtilitiesFlatString()
Returns string form of utilityList. |
java.util.ArrayList |
getUtilityList()
Get the utility list. |
void |
outputActions()
Output list of all actions to the console. |
void |
outputGame(java.lang.String filename)
Print game to filename. |
void |
setDominatedEnumeration(boolean[] dominatedEnumeration)
Set enumeration of dominated strategies. |
void |
setEfficientIndex(int efficientIndex)
Set index of the efficient equilibrium. |
void |
setEquilibria(java.util.ArrayList<double[]> equilibria)
Set equilibria to this game and enumerate their types (dominated, efficient, mixed/pure) |
void |
setImportanceGamesList(java.util.ArrayList<Game> aImportanceGamesList)
Set importance games list. |
void |
setNumMixedEqu(int numMixedEqu)
Set the number of mixed strategy equilibria. |
void |
setNumPureEqu(int numPureEqu)
Set the number of pure strategy equilibria. |
void |
setOutcome(Jama.Matrix outcome)
Set simulated outcome. |
void |
setPayoff(Jama.Matrix action,
int playerIndex,
double payoff,
boolean report)
Sets payoff for specific player and action. |
void |
setPayoffList(java.util.ArrayList<Jama.Matrix> payoffList)
Set the payoff List. |
void |
setPureEnumeration(boolean[] pureEnumeration)
Set enumeration of pure strategies. |
void |
setUtilityList(java.util.ArrayList<Jama.Matrix> utilityList)
Set the utility list. |
java.lang.String |
stringVector(Jama.Matrix x)
Convert Matrix to string. |
java.lang.String |
toString()
Returns a string representation of the game. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Game(int numPlayers, int numActions)
numPlayers
- Number of players.numActions
- Number of actions.Method Detail |
---|
public Game deepCopy()
public double getExpectedValueEquilibrium(int equilibriumNumber)
equilibriumNumber
- Index of the equilibrium the expected value is to be calculated for.
public double getExpectedValueEquilibrium(int equilibriumNumber, int playerIndex)
equilibriumNumber
- Index of equilibrium to evaluate.playerIndex
- Index of player to evaluate.
public void findEfficientEquilibrium()
public Jama.Matrix getSimulatedOutcome()
public double getProbabilityAction(int actionIndex, double[] x)
actionIndex
- Index of action to compute the moment for.x
- Vector of unknown parameters.
public double getLambda(int equilibriumIndex, double[] x)
equilibriumIndex
- Index of equilibrium to be evaluated.x
- Vector of unknown parameters.
public double getHQRatio(double[] x, java.util.ArrayList<Jama.Matrix> expectedProfitsList)
x
- Vector of unknown parameters.expectedProfitsList
- ArrayList of deterministic expected profits.
public void calculateUtilities()
public void generateEmptyPayoffList()
public int findIndexAction(Jama.Matrix findMe)
findMe
- Jama.Matrix representation of the action to find.
public void outputActions()
public void setPayoff(Jama.Matrix action, int playerIndex, double payoff, boolean report)
action
- Action to assign payoff to.playerIndex
- Index of player.payoff
- Value to assign.report
- Switch to print debugging information.public java.lang.String getUtilitiesFlatString()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String stringVector(Jama.Matrix x)
x
- Matrix to convert.
public void outputGame(java.lang.String filename)
filename
- Name of file to output game to.public java.util.ArrayList<Jama.Matrix> getActionList()
public java.util.ArrayList<Jama.Matrix> getPayoffList()
public int getNumPlayers()
public int getNumActions()
public java.util.ArrayList<double[]> getEquilibria()
public void setEquilibria(java.util.ArrayList<double[]> equilibria)
equilibria
- Array containing equilibria to be enumerated.public Jama.Matrix getOutcome()
public void setOutcome(Jama.Matrix outcome)
outcome
- The simulated outcome.public java.util.ArrayList<Game> getImportanceGamesList()
public void setImportanceGamesList(java.util.ArrayList<Game> aImportanceGamesList)
aImportanceGamesList
- The list of importance games.public int getNumMixedEqu()
public void setNumMixedEqu(int numMixedEqu)
numMixedEqu
- Number of mixed strategy equilibria.public int getNumPureEqu()
public void setNumPureEqu(int numPureEqu)
numPureEqu
- Number of pure strategy equilibria.public void setPayoffList(java.util.ArrayList<Jama.Matrix> payoffList)
payoffList
- ArrayListpublic boolean[] getPureEnumeration()
public void setPureEnumeration(boolean[] pureEnumeration)
pureEnumeration
- Enumeration of pure strategies.public int getEfficientIndex()
public void setEfficientIndex(int efficientIndex)
efficientIndex
- Index of the efficient equilibrium.public java.util.ArrayList getUtilityList()
public void setUtilityList(java.util.ArrayList<Jama.Matrix> utilityList)
utilityList
- The list of utilities.public boolean[] getDominatedEnumeration()
public void setDominatedEnumeration(boolean[] dominatedEnumeration)
dominatedEnumeration
- Enumeration of dominated strategies.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |